#!/bin/bash

# 参数：$1 - 操作（start|stop）
# 示例：./start-stop.sh start

if [ -z "$1" ]; then
    echo "Usage: $0 <operation>"
    echo "Supported operations: start|stop"
    exit 1
fi

PWD =$(pwd)

if [ "$1" == "start" ]; then
    docker run -d --name triton_server -p 8000:8000 -v  ${PWD}/model_repository:/models nvcr.io/nvidia/tritonserver:22.12-py3 tritonserver --model-repository=/models
elif [ "$1" == "stop" ]; then
    docker stop triton_server && docker rm triton_server
else
    echo "Invalid operation. Supported operations: start|stop"
fi
